bitkeeper revision 1.202.1.1 (3eb29479NSt9W43l1WHqpd10S9llKA)
authorjws@cairnwell.research <jws@cairnwell.research>
Fri, 2 May 2003 15:53:29 +0000 (15:53 +0000)
committerjws@cairnwell.research <jws@cairnwell.research>
Fri, 2 May 2003 15:53:29 +0000 (15:53 +0000)
console command line fix

xen/common/kernel.c
xen/include/xeno/console.h

index 4d5a2deba05e4509a96fb94c455c2f9d894913fa..a9ae7383d23ab2a059f4dca7b49fde387cffaa67 100644 (file)
@@ -33,7 +33,7 @@ void init_serial(void);
 void start_of_day(void);
 
 /* Command line options and variables. */
-int opt_console = 1;
+unsigned int opt_console = 1;
 unsigned int opt_ser_baud = 9600;  /* default baud for COM1 */
 unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */
 unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
@@ -45,7 +45,7 @@ static struct {
     int type;
     void *var;
 } opts[] = {
-    { "console",  OPT_BOOL, &opt_console },
+    { "console",  OPT_UINT, &opt_console },
     { "ser_baud", OPT_UINT, &opt_ser_baud },
     { "dom0_mem", OPT_UINT, &opt_dom0_mem }, 
     { "ne_base",  OPT_UINT, &opt_ne_base },
@@ -56,6 +56,7 @@ static struct {
     { NULL,       0,        NULL     }
 };
 
+
 void cmain (unsigned long magic, multiboot_info_t *mbi)
 {
     struct task_struct *new_dom;
@@ -66,17 +67,16 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
     int i;
 
     /*
-     * Clear the screen. Note that serial output cannot be done properly until 
+     * Note that serial output cannot be done properly until 
      * after command-line arguments have been parsed, and the required baud 
      * rate is known. Any messages before that will be output using the
-     * seetings of the bootloader, for example. Maybe okay for error msgs...
+     * settings of the bootloader, for example. Maybe okay for error msgs...
      */
-    init_vga();
-    cls();
+#define early_error(args...) opt_console=1; init_vga(); cls(); printk(args)
 
     if ( magic != MULTIBOOT_BOOTLOADER_MAGIC )
     {
-        printk("Invalid magic number: 0x%x\n", (unsigned)magic);
+        early_error("Invalid magic number: 0x%x\n", (unsigned)magic);
         return;
     }
 
@@ -86,13 +86,13 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
      */
     if ( (mbi->flags & 9) != 9 )
     {
-        printk("Bad flags passed by bootloader: 0x%x\n", (unsigned)mbi->flags);
+        early_error("Bad flags passed by bootloader: 0x%x\n", (unsigned)mbi->flags);
         return;
     }
 
     if ( mbi->mods_count == 0 )
     {
-        printk("Require at least one module!\n");
+        early_error("Require at least one module!\n");
         return;
     }
 
@@ -161,6 +161,11 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
         }
     }
 
+#undef early_error
+
+    init_vga();
+    cls();
+
     /* INITIALISE SERIAL LINE (printk will work okay from here on). */
     init_serial();
 
index e5cb947b2fba29102fb2a0a08dd26b727d26aa09..3208b1e3a9e8b9d6ed85875483a91d9da662045a 100644 (file)
@@ -29,4 +29,4 @@
 #define CONFIG_OUTPUT_CONSOLE 1 // but see also opt_console
 #define CONFIG_OUTPUT_SERIAL  1
 
-extern int opt_console;
+extern unsigned int opt_console;